Minor bugfixes and polish.