Bugfixes to the last commit