A few changes to improve compatibility