Some changes and bugfixes.