Fix terrible things, unit tests coming soon