Bunch of fixes afther sql-alchemy removal