Remove empty strings in compact function