Fixed some issues with module handling and removed the gross clojure in del_ptr()