Original commit message from CVS: Re-arranged the build a bit to try to make it more sane. Added some debug.