Fixed bugs in packet handling

Also added CryptoSample project.