Bug hunting #4

Next step is valgrind:-)