Patched some bugs.