Fix to work with different string format and bad data