Here are a few patches that I made while getting started with the code.