Fixed some issues with parsing functions and complex expressions