Added some packet handling functions.