Some incomplete fixes

This patch adds some fixes to a try a clean build of this first version
of the source code.