Moved some external libraries from depends to imports. Minor bugfixes.