Fixed constructors to have proper None values for optional parameters
and improved current working directory detection.