Import cleanup
Fixed some more UTF-8 related problems and did some code cleanup