Bug fixes

**Not ready to merge**

Fixing bugs...