First round of bug fixing!