Version 4.0

Made some fixes about the way logs were trimmed.