Fix mutable bug in finalize schema function.
Merge pull request #155 from 4teamwork/jone-finalize-bug

Fix mutable bug in finalize schema function.