fix typo
import changes from spacecadet
audit integer math
add add'l checks for broken program args
add add'l invariant checks