Fixing unexpected end