Fixed a few bugs

Resubmitting against `unstable`