Fix a bunch of compile warnings.

I wasn't entirely sure about the `time_until_wake` though.