head command should work according to protocol

Currently head always returns the first four bytes. It should be updated to fit the protocol.

Edited by Serdyukov, Denys