Added proper install process; fixed bugs in UT