Essays in corporate finance : financial contracts and their implications