Fixed hopefully dependencies. TODO: move to hooks instead of before template.