Fixed infinite recursion. Fixed more issues