Fixes issue #1 as per @commiejim