correct memory deallocation in tests
mark C code
fix filestream