Small bugfixes in utility module