Fix dependencies and other small bugs