Bug fixes

7 bugs squashed!