Added null check to Structure.rotate