A few bugfixes.