Shorten Libraries.hs, and fix some types in some of the libraries.