Fix string parsing and update tests