fixes issue #621 and #603 for bootstrap2