ligolw: two bug fixes and improvements