Fixed rox tests and potential memory leaks