Fix for default codec. Based on PR #1829