Parse multi-line errors properly and fix tests