fixed a lot of minor problems and inconsistencies