Cleaned up some code related to language selection #2242