Fix bug with implode function