Remove redundant braces.
Simplify rewind-related conditional.
Clean up clock_gettime() error handling.

Returns -1 on error.
Fix remaining val/addr naming inconsistencies.