Bug fixes after DB fix