Fix potential bug found by Armageddon Monkey