Complete fix of #6