Ran JSHint, fixed stuff and added flags.