Fixing typos and debugging stuff