Fixed the writing of the wrapper