DB: Small bug fixes