some bug fixes etc.