Bug-Free

The code now works as intended, and is, at the moment, bug free. Or very
close to bug free, as there may still be a problem somewhere, I haven't
found yet.