fix crashes with invalid number format