CHOP-29. Added support for local mode.
Changes from review.