Revised constraint module.

Added correct return type to the attach error message function.
Additional documentation.