fixing a variety of cuda/ann related problems