Bug fixes
More test cases