Repackaged and fixed a few bugs.