Added some tests and fixed some minor bugs in Functions evaluation.