fixed bugs found via db:reset