Fixed token replacement in Reference.java