add several missing functions.  Fix linkage scheme.