bugfixes in some scripts