Correct issues in the patch to make it compile