Fixed and tested build on nix