Code review and bug fixes (squash later)
STUD-946
STUD-947