Controller auto-detection. Context logic improvements.