Fixed invalid cast

revpos is an int, not a long.  Previously, it would cause a exception
when it tried to cast it to a long.