Fixed all parsing errors and removed global