fixed test for custom functions
fixed various tests and added checks for unparseable expressions