various fixes for library