Bugfix for issues #730 & #751