Partially revert 9393f239ff, moving dist-check in-line

Change-Id: Id89c8b675b3d6892f3779a696972c70bf504aa7c