Patched up some bugs.