Bugfixes for #14