Fix static analyzer warnings

Fixes #89