Fixing a couple glaringly obvious bugs in my implementation.