Fix settings code