Add tests for sort