Allow error messages in early initialization

Close #86

Set scriptmode variable very early in initialization
methods such as error method can use it.