Fixed parser to handle negative numbers