some fixes and some new cuda stuff