Fix weight logic