Added tests for rotation.get_candidates() and fixed some related bugs.