fixes logic in getPath function to return first detected class

Also removes unnecessary debugger statements.