Fix improper time includes, and fix accessing empty std::vectors.

On windows we can't access vectors of length zero, and doing so will throw
runtime errors in debug mode.

Closes #31.