Corrected handling of nested depth

Fixed the points that determine when to go to a new s-expression.