fixed some bugs

I fixed some bugs to let bipio work