fixed some problems found with non-latin1 basefiles
some test code