Added test project; fixed code errors