Added NDEBUG macro around ptr_in_range