Fix for buffer overruns and reorganized makefiles.