Partial fix of feature4.
Fixed bug#2.
The rest of the feature4 fix.
Merge branch 'fix-feature4'