Finalizing stuff, correcting bugs