Added missing dependencies.
Cleaned up code.