Fix a few things.

No idea how stuff was even sort of working before.