Moved update palette call to a more specific location; Added missing semicolon