Another bug fix for GPU implementation