Bugfix: when commits sorted by weight, if weight is nil there's an exception. Now, commits are sortered by 'weight || 0'.