fix syntax error in previous commit. and issue 12: empty optional fields should not be sent