Now checks ports correctely - I hope.