Minor fixes

Adding some conditions to prevent empty content errors