Fixed bug where NOT_DEFINED was being passed for fields that where not defined! Added test case to test for the issue