Some fixes & compatibility to 4.7