Patches to fix minor bugs in code.