New attempt at fix for #39