Fix bugs and add requirements