Fixing up stuff in lib