Fixed issues with outputting empty list items in the correct places