Fix some issues with codes over version 10. Still some issues remain.