Fix bug: unset bits properly