Fixed some dependencies, bug fix