Proper buffer management. Don't segfault if no device!