Sort out some library issues