fixed some issues on multicore devices