Several bugfixes and improvements (container)