Fixes crash on empty adapter. Closes #2