Updated for QuickCheck 2.7 with patch from Michael Snoyman.