Better version change detection (fixes #808, fixes #810)