! Fix a bunch of bugs found while testing

Signed-off-by: Michael Eshom <oldiesmann@oldiesmann.us>