Bugfix #732 part 1
Bugfix #732 part 2
Merge remote-tracking branch 'glorf/bugfix-5'