1.8 compatibility changes

For comparision with #152 and #147