Parameters changed to primitives, mouse handlers fixed