Fix dependencies and code