Fixed errors with defaultValue support and added correct handling of JSON types