Update the files to cope with upstream update. Plus fix a bug in #2