NSBitmapImageRep on 16-bit screen

I have a weird problem and am not sure what is causing it. If I run my code with my screen set to 32 bit color the program works fine, it is drawing a 16 bit NSBitmapImageRep in an NSView. If I then switch to a 16 bit color screen for some reason my NSView starts having bits of my desktop drawn on it in addition to my graphics. It looks like it's not clearing the drawing buffer but I know it is since the program hasn't changed it's just the depth of the screen that the window is on that has changed. Any ideas would be appreciated.

EDIT: I realized there might be some confusion with what I said. I'm chaning the screen resolution with System Preferences (not while the program is running). The Cocoa window that is drawn behaves differently depending on the desktops bit depth. At 32 bits it works fine but at 16 bits it does what I described above.