Improved error checking, ready to merge to develop

[#53234957]