fix some bug and sync some code from luci-theme-bootstrap