Squashed a few bugs, haven't finished yet, though.