Replaced SizeMismatchException with std::runtime_error