Support custom fields with '#' in their name.

Patch contributed by Ryan Niebur in RT#83856.