Fix Class cast exception (see #11792)
Fix check if not empty
Merge pull request #1874 from jburel/saved-by

Saved By