Bugfixes, made log functionality better.