Some tests implemented and minor overall changes