Bug fixes to discard option