Fixed issue 323 by properly adding padding when generating the binary data for use with nc_put_var/vara. Also added second testcase.