Added more tests and such.  Fixed a couple bugs