Bug fixes

- Fixes #1
- Fixes #2