Fix bug in Record encoder

• Stop double writing length/null value