fixed version masking. minor improvements elsewhere