Added tests for AtMostTimes and BetweenTimes and fixed revealed bugs.