Fritz bug fix

Second commit is the actual bugfix. Rest is jshintin