Fix dependencies in controllers and db_helpers