Added catching exception for used reflection.
(cherry picked from commit 31d8818)