Fixed generic errors, cleanup