1.8 compatibility changes

For comparison with #152 and #147
trying to figure out the segfaults... didn't help in the end :(