Fixes issue with jsvalidator adding undefined to objects.