More fixes thanks to @timo++'s feedback.