Minor improvements for sharing

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>