Got rid of some bugs