Fixed major GC bug.
Unit tests for function calls