Fix generator bugs, binary and schema copy