Fix for get device ptr