correctly set reference when given blank or nil ref. add support for _ref stripping by Inflector