bugfixes in init code