Fixed some issue found with JSHint