Fixed a set of bugs (one of whose symptoms was an inconsistant number of keypoints being generated).