Just some bug fixings