Finally implement #326 (originally one of oldest open bugs from codehaus issue tracker!)