Initial work at fixing StateT issue.