Improve replication controller errro handling.
Merge pull request #1609 from ddysher/fix-controller

Improve replication controller errro handling.