set autocommit (not sure it helps)
add get_mostrecent_command()
many improvements in communication of scan-state