Bugfix for endContainer