Fix errors when there are no spliced genes.
Fix some minor errors caught by valgrind.