some tweeks to decoder and tests