Improvements and bugfixes.