corrected handling of leak detection flag and added corresponding tests

The use of the leakDetection flag `-l` is actually inverted compared to the meaning of the other commandline flags. If passed, it disables the `leakDetection` feature. This patch accounts for this type of behaviour by allowing for a switch to be marked as _inverted_.