Update core.lua

Fixed: Auto shutdown error (fixes #107).