Fixes suggested by @cdeil