BTW, I found this bug/typo while doing this conversion. add_message() should be add_error() I believe.