Fixed rotate demo to be more robust