add handshake ack and fix handshake bugs

Change-Id: I7b319a6e95ceb9d893a734f41cd6219d232575e5
Merge "add handshake ack and fix handshake bugs" into 0.3.x