many bugs fixed
Merge