Fix issue 78 and 81