Bug fixing for rotation and "edge block"