Fix issue 31 and add missing files