Some bug fixes, TODO: measurement time correction, ..