Make some changes in order to make it run in 1.8.6