Port exception_registration branch to 4.00
Port exception_registration branch to 4.01
Uniformize error reporting