minor bug fixings