Fixed some errors, still need to sort out sending ACKs and errors