Fixes for Linux and database