Fix get_revision, small cleanup in build