Minor changes

Clean up some stuff here and there, one day I will find the time
to rewrite it from scratch, perhaps.