Fixes for #310,#293