Corrected bugs in rotate; added tests for rotate; fixed return type of lbp