Fix some SNAT issues

This patch fixes some issues and
add a unit test related to the fix.

Change-Id: I4ccb65960e2d7892d2a34724df34e3f75d1385a8
Merge "Fix some SNAT issues"