Random port binding + small fixes

DO NOT MERGE YET