Fix of bug 8 and 16