Fix deprecated warnings & build issues