Deputy chief demoted after harassing officers