Prevent aborting when there's nothing to commit

Also add debugging information.