truncate MANUAL_DEPS before appending to it
fix manual deps logic