Tweaks and upgrades for bs 3.1