Tiny change in rotByN

Added a check for negative numbers