Fix compile errors in model