Tweaked codec to use faster (hopefully) opcodes