bug fixes to json-to-mysql