remove dependency on kapteyn and some minor fixes.