Fix code according to @starwed and @sbyrnes321 hints

See https://github.com/craftyjs/Crafty/pull/556#issuecomment-26255256