issue #2771:  fix collision bug cause by dynamic/static cast.
issue #2771:  add some warning log
issue #2771:  fix crash bug
issue #2771:  fix a careless mistake
Merge pull request #4348 from boyu0/iss2771_physical

issue #2771: physical bug fix.