Fix #501. Writes with invalid payload should be rejected