Added test programs and fixed #10