Fix if ~ elif ~ else for performance.