Correcting some bugs in CBMainWindow.m
Need to work on more on Cocoa.