Added improvements by Mloc.