fixed bug in simulator.
get device handles none existent device better.