Bugfixes and typo corrections