Critical bug fixed. More comments. More tests