coverity#1078601 Unchecked dynamic_cast

Change-Id: If8e69fa6ec433be7bc8c8f67a6de55537f7201bf
coverity#705541 Unintentional integer overflow

Change-Id: I6fbafabe98de3b168a8f79c4c2fde4a4537f6eb1
coverity#705538 Unintentional integer overflow

Change-Id: I50f0701bea8f2f2e00a6b1396ba7cfbf5e0bd00c
coverity#705533 Unintentional integer overflow

Change-Id: I24a9310471bdcfc91080382b3c637982788e68d7