Upgraded to support 1.9 and 1.10