Finally fixed #1. Now we just need cleanup.