Fixes #928 for sure. also improved debug possibilities.
Should fix #1026
Merge pull request #1057 from Gravecorp/test

Fixes #928 for sure. also improved debug possibilities.