Bug fixes to core library, and Linux compatibility