Ability to set custom encoding for B/K/V

Also fixed a broken testcase