fixes from @schwancr