coverity#1219715 dereference after null check

Change-Id: I36ddbef50da52dcf1e22b47d94a759606fd818a2
const_cast is no longer necessary

Change-Id: I8573498decad389693da324f7e3132e91fc71bb8
coverity#1132886 missing break in switch

Change-Id: I93facc400851d4ec698769a4bc665859b0fa0245