Fix auto fit when using primitive mask