Fixed some bugs on CSC 185