Fix bug convertion from/to enum in ObjectExtension