Fixing error. This should be ready to merge after tests pass.