minor bug fixes for diff analysis