Fixed a bug in slave when launching container.

Review: https://reviews.apache.org/r/24440
Reverted a refactor that broke the build.