Fixes issue 176 and 177