Fixed issue with optional attributes on entities