Receive tests. Fixed a couple bugs along the way