Added #include <stdexcept> to several files.