Fixes to avoid build and buffer-overflow problems

These two patches address the two reported problems with lcut.  See [lcut issue 1](https://github.com/bigwhite/lcut/issues/1) and [googlecode issue 7](https://code.google.com/p/lcut/issues/detail?id=7)