Fix issues with AppDomain.CurrentDomain.BaseDirectory