Fix reference field bug

Bug reported as issue #1 in lfurzewaddock/Coevery-Orchard fork

Original Commit: https://github.com/Coevery/Coevery/commit/7765272b5d040f82752dc7c26bb8578cec78661c

Author: zhangjn
Date: 14/11/13