Some small fixes

- fix some scrutinizer identified issues
- resolve #226