Replaced "function" with "$function" so error messages actually mean something :)