'Merging' kenny3794's fix for #21