Added test mode options and more logging