js and views little fixes

Hello, please review and merge my changes.