Formatted; errors/warnings fixed; JSDoc fixed