Fix stupid bugs in non-tested commit af288220f87c21e55697a1cb0a6b8f61dfdb1905.