A lot of work/fix for 1.7