Fixed JSDoc and simplified conditions