Some tweaks to work around errors encountered with empty content 

@ischneider, please fix up if necessary