some patches for 1.7