Comment the library code and fix some minor issues