Bug fixes for composes and random function gen