Cleanup to make it compatible with 1.4.6