Fix analyzer complaint

Fix some casting issues