fixe character encode, global var lookup, file path bugs