Fixed some small bugs, cleaned up notebook a bit