Set default values and misc cleanup