fixed bug in discard
Merge pull request #108 from jmoborn/master

Discard bug fix