Added background receive thread, tweaks.