Better invalid burn handling

This fixes the burn bug elucidated by block 283811. The source of the problem is that a number of variables were undefined in a situation where burn was invalid. The burn is still marked as invalid, but now it doesn't cause an exception.