Stability improvements to hardwall function.

Change-Id: Idbc245e49999effa9fef8e3d016d526e35307cd9