Improvements and many various bugs fixed