Fixes mask parsing issues in rare cases #14