Merge pull request #90 from rudigens/master

Pull latest changes
Found a little problem with writing to output files.
Merge pull request #91 from rudigens/rtc

Push latest changes.