+ Add error to 'decodeRef' on bad reference
+ Makeup
+ Unify function signatures, error messages and code structure
+ Fix 'test' target