Bug fixes and DB update