Fixes function reference errors