Fixed some minor crashes.
Merge branch '2.1_bugfix'