fixed compile errors
fixed null pointers when wildly using measurement tool
Merge pull request #9 from hwbllmnn/measurement-fixes

Measurement fixes