Defensive programming
	- Added check for max domain length
Minor fix
	- Added const iterator