Unit tests do not segfault anymore now

Fixed tons of uninitialised memory bugs