Improve player code handling.