Fix expected exception messages in tests