Corrected checks on $MEM