Refixing of bugs #2 and #6