fix implicit downcasts
Readability
Readability
Fixed a bug where remaining might be used in a way where it would go negative
Merge pull request #403 from mr-c/graphalign-1.0

Graphalign 1.0 fixes