Some tweaks. Found a bug in checksums function, but now the test for checksum on unchanged packet fails.