Issue #887/#888

The PR includes fixes for #887 and #888 (file vesron).
Hmm, on lines 68 and 69, I'm sure you're doing the same test twice.