Changed default output filename handling. Added #! line for Linux execution.