fixed lots of little mistakes in the docking code