core.moduleapi: Fix some global accesses.