Applying Mandrake's diamond block fix to the 1.6.4 branch