Stats and small bug fixes