efactor GetPtrFromObj / fix compiler warnings