Adding changes from official fork