Fixing a bug in that regex for object types