Fixed the issue with just casting to an int. Perhaps I can cast to a uint instead, or something?
Fixed parsing problem with array names by making them capitalized. Also fixed some--but not all--problems with the generated sketches.