bugfixes in libaray