Solves a few issues with genLibrary

Namely, closes issue #27, issue #17 and resolves issue #13