fixed return values and fixed broken tests