Fix bogus returns when dealing with multiple discrete outputs

When looking for largest activating output, code was incorrect.
Merge pull request #18 from mongi3/master

Fix bogus returns when dealing with multiple discrete outputs