Added test for resetting namespaces. Fixed stack unwind bug