some more changes and tests for the codec code