Fixed segfault during move generation. Perft now works.