Fixes in ValidateStruct function