StringWriter.getBuffer, System.mapLibraryName, and makefile cleanup