Clean code, fix segfault.