fix rainbow mode and compiliation errors