Fixed reference errors