Added default values to some parameters
Call std::exit instead of exit