Tweaks from pelagir fork