Changed main layout. Fixed a some strange bugs that started to appear suddenly