#JC-1809: Fixed post size calculation. Added unit tests