some improvements/fixes