Fixing 2 reference errors