heavy: add error checks, fix strict aliasing and linux

The core problem was the cuda hefty Thread per block set to high
but took me several hours to find that...