Bugfixes and losened many constraint on deviations.