Better solution for #39.