fix os env var port bug and actually parse flags