Fix some issues found by Kyzentun.