* add support for pause, fix a couple bugs.