Added and optimized unit tests
Fixed minor bugs in Pagination