Fix a test bug for using copy_reference_file.
Fix build failure on Ubuntu.