Fixing many things - mostly codec framework