Adding some timing measurements, minor improvements