fixed extraneous close res and moved tests