Fixing issues with default value being undefined

+ cleaning up test cases