Add fread return value checks.
Adding missing strdup call (fixes segfault).
Fix integer overflow in hash function.
Ensure handler table (not just entries) is freed.
Fix memory leaks in virtual machine.
Update sample program.