Fix an exception in the flask ext code.