Bug fixes and add [-copyWithZone:]

This reverts commit 42c92f6b4dd922c657d766579155628966f7561d.