Fixing a lot of issues that none of my unwritten tests caught thanks to the example app.