Encoding problem. Correct few bugs