clRetainDevice causing problems