fixed function tests and improvements
alloc/dealloc test + fixed function fix