Removed unneccesary undo operations in activity heuristics