Fixed incompatible returns.  Also made a few internal function into static functions.
Fixed incompatible returns.  Also made a few internal function into
static functions.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb