Fix bugs and make sure this thing works.