Bugfixes and typos