Add tests to _isInsideComment and misc bugfixes