Make shared_ptr use more consistent.
Fix crash trying to compute a file location at end of file.
Merge branch 'master' into new_approach

Conflicts:
	enigma-ck2/enigma/ck2/Game.cpp
	enigma-ck2/enigma/ck2/sema/CharactersAnalyzer.cpp