Added -n option, and improved gs testability