Fixed some errors; some issues remain