Busted some bugs, added some performance improvements

Noticed #6