Fixed wrapping of exceptions