Many different bug fixes. Now passes all VM tests.