Added fixes and improvements to rejection reasons code