Fixed some unroll bugs