Added small bug fixes