Fixed tableau to be dynamically allocated. Fixed nasty valgrind errors.