Fixed more scoping errors and an error with quadrant mapping