Added fixSchema function