Fixed constrain() w/ tests and fixed test suite