found several bugs while testing kext2ffs

some bugs and some beautify