Patched up minor bugs