one more bug fixed, tests improved