Minor code cleanup, fix for linger timout in errgen and cmd line options parsing