some fixes for #343