Added fixes asked by @matjaz.

Fixes #4