Issue #181

This fixes the issue, tested with a JSON output and a Turtle output (the latter really shows the difference and correctness). If any more testing needs to be done before this pull request can happen I'd be glad to look if I can be of assistance.