Add memoization for has_changes
import errors