lots of bug and poitnerabuse fixing
more small fixes, cleaned debug