Makes a few changes provided by @kai-koch