Clean up decoder to match encoder changes in issue 490