Revert "Merge fixes from ImageMagick official trunk"

This reverts commit db4372b3c67136bbf6ce7c8c90bad0d96534770a.