Fixed some errors, added packet utility methods