Added tests for isValidReference