Remove emtpy lines from beginning and end of blocks