bugs fixes etc

sqd