Revert "Error when unable to cast to expected type"
This reverts commit c81e74d187b1dff80278cc291a501bca4e73aff1.