Merged Alin Andrei's changes. Fixes depends bug.