Port now parsed as integer and improved exception handling