minor tweaks to generator and scanner edge cases