Added debug
Fixed some parsing issues