Revision detection change contributed by robin28 for #1