fixed invalid index in buildChangeDetails, fixes #1858