Fixes substitution of numeric and hex refs #531