Issue 328: bug 1 & 5 fixed