minor fixes, more idomatic bb code