Started adding test for virtual device. Fixed bugs in peer_socket and virtual device