am 71d52474: Merge "Optimizations and safeguards."

* commit '71d52474fd380f967287cd5eee0084791463d162':
  Optimizations and safeguards.