bugs fixed in tests