Issue #505 fixing bug in master