Replaced with-output-to-file with an explicit open/close due to posible file handles being left open. Fixed bug in runner time sharing.