Fix top-level function errors in strict mode

/cc @wheresrhys