Fixed a couple of bugs. It's working now.