Some more bug fixex