Fixed major bug in ptr making all sorts of problems