fix FIXMEs and a huge bug in keypoints.c