Fixed compilation warnings and moved timespec math functions to common_utils.h