- fixed broken tests introduced by Jocelyn's changes (oops. I should have checked that)
- reverted casting change, because it produces many pedantic C errors.