Fixed StringBuilder appends and some type declarations.