Updated crafty code to account for new API changes