bug and docs fixes