Fixed file chooser.

Fixed color palette logic.

Color palette bug exists when colors are overflowed.