Add newlines to error messages caused by exceptions
Fix UB, which caused garbage value in the xml path in mdb on BSD