Fixed errors returning values + cleaning