Fixed some bugs so that the packet parameters will be set correctly