bug fixing; new tests