Fix compile time errors.

Errors discovered while testing on OpenBSD.
* malloc.h is obsolete.
* std::string::npos is a size_t so make sure it's comparison is too
(warning: comparison is always true due to limited range of data type)
Merge pull request #1 from jturner/master

Fixes some warnings that are treated as errors due to -Werror.

Much appreciated.