Critical fix for #153 merging bugfix branch