Fixes thanks to Sébastien Hinderer.