Fixed bug on copying schema