This fixes #672
Small bugfixes.