Fixed some small rotation related bugs