Further improvements to encoder handling