continue porting, fix #14 and fix #16