Handling of optional fields needs to be fixed