bugs fixed + test OK