A few little bug fixes to make it actually work