Fixed some things to make the patch compile.