Fixes to comments, formatting and code for latest additions

Change-Id: Ia89a35678e1c1f7ea20303e131fb403c46ac2eb1