Fixed a few issues found in the main library code