Fixes of bugs #2 and #6