Removed copypaste code. Actually don't now why I did it before, but it seemed me necessary then.
Fixed bug with too short frame of results in case in results are shorter than header.
Some refactoring.