Slight improvement in variables alignment
Fix misplacement of else/elseif within foreach