Modal forms dropping # in the address I have made neat comment link for anonymous users http://example.com/modal_forms/nojs/login?destination=http://example.com/comment/reply/NID#comment-form
However when I click it then the #comment-form is missing and it's very inconvenient because have to scroll to the comment form, how to fix it? 

Here's the code responsible for opening login links in modal window:

Drupal.behaviors.initModalFormsLogin = function (context) {
  $("a[href*='/user/login'], a[href*='?q=user/login']", context).each(function () {
    this.href = this.href.replace(/user\/login/, 'modal_forms/nojs/login');
  }).addClass('init-modal-forms-login ctools-use-modal ctools-modal-modal-popup-small');
};
Unless you URL encode, the fragment (what you have after the # sign) is not sent to the server. 

If you want to include the hash in the destination parameter, it has to be URL encoded. 


  http://example.com/modal_forms/nojs/login?destination=comment/reply/NID%23comment-form


Note the %23 above. It makes the browser think that the fragment is part of the destination parameter.