fix bug where bias was written as all 1