Fixed segfault, added TODO