LPS-41028 Fix possible exception and source formatting