Small fixes related to sharing