Merged my changes to jgit_beta, and some patches from master branch