Fix from new master and some warnings