fix bug
scripted update of code from master at f3302c0 fix bug