fixes #377 - bug with valid references that are invalid expressions