Bugfixes.

- Fixes #161
- Fixes #152
- Fixes #148
- Fixes #105
- Fixes #94