Various bugfix.