Add some safety checks to magic damage