Bugfix: empty language header results in null exception

Hi turguoiseowl,

some bots don't send a language-header. This resulted in an empty language-array and a null exception.
I fixed this (lines 26 + 92).

The other changes are from Visual Studio (reformat document).
(If you want, I can revert them.)