Add some more test cases
Add QuickCheck tests
Handle null cases