Ensure bind succeeds in test
Fix several bugs in original patch