[v2.0.4] More bugfixes and code cleaning.