Fix port parsing and pass it along to env