Collapse.js bugfix and minor cleanup