Fixed null handling, fixes #50
merging feature/null-issue' into develop