Added length checking for most packets