db: handle returning block statements better