Update core.php

Fix for issue #37 by @quokka