Multiple fixes and touchups to the library system mainly