fixed code formatting
fixed a bug that occurs when packing a string shorter then defined by the format