Fixing 'elseif' implementation