some bug fixes etc
resolved conflicts - fixed bugs