BZ977 Fix for endpoint/port initialisation (Patch from Quynh Nguyen)