Some fixes in main block