Added checks for unsafe reflection.