fix undefined procedures to allow hooks as before.
fix bad exit from undef code.
fix reloading of foreign files: don't allow it even if you are
reconsulting, it makes no sense.