Fixed "parse undefined" and expand/collapse