Dependency Resolution and Bug Fixes

See commits for details.