Fixed typo and warning in generateAsync

I don't like having those pesky Java warnings from unused imports. This fixes that by only including the import when needed.

Also fixed spelling typo, since I don't fancy those warnings either. :)