Fixed a few bugs

TODO next: start testing