bash: some random improvements