Logic error correction
Merge pull request #1269 from Wurstnase/Development

Logic error correction