Discard compressed output when it exceeds the input size.
Formatting consistencies: replace tabs with spaces and fix else if block.