Improved an error message as the ref was always FALSE on error