small fixes for new db schema