Fixed empty main block bug