Fixed GetMaxAction to work with GPU.