Fixed crashes with palettes, fixed whitespaces