Fixed issue when define restoration is too soon

If the bundled file is loaded dynamically, the current script might be
the first one.