Make error paths reported for missing references consistent

Fixes #64