Correctly serializing Booleans and numbers, and tidier code.