Added a test and fixed the implementation of the successive repeated positions case. #3