Patched code fixes