Constraint fixes, and fixes to background threading.