Merge Daniel's second fix (71cabc5) and handle the conflict codes.