Handle EOF of stdin gracefully - fixes piping commands into sosh.
Fix comparing unitialized value.