Fix container scripts in certain cases (bug 882)