various fixes for rotation and 5.1 crashing issue