JSDoc & some fixes