add patch by balrok, some small things