Some type updates.
Update parameter handling of error models to use structs; still global.
Declare height and width of type size_t.

Avoids negative offsets and improves diagnostics in some places.