Various fixes. Added dependancies.