Fixes for #308
Fixes for #308