Added option to build tests
Fixed tests so they compile & pass