Issue #887/#888

The PR includes fixes for #887 and #888 (file vesron).