Changes copied from:
https://github.com/nathanmarz/storm/pull/460/files