Fixed thread-unsafe object canonicalization routine.