Fix bug where new maintenance record not correctly created.