fixed memory leaks in test pages; got rid of single test mode