Added port configuration and did a lot of fixes for 4.2