Fixed a bug and did some testing.