Fix some stuff, add some comments