Add getSafeAs method
Minor