Added some fixes to main script