Some small bug fix