Fix double use of db_result() bug when assigning handlers