Fix for encoding