Updated with last fix & improvements (see master repository)