Fix JSHint issues, moved a few things around.