some small fixups in main