Small improvements to docking code.