Keep theta in range