Constraints added and some cleanup.