Small fixes for encoding restriction