fixed some container related bugs and added a container test