Various cleanups & simplifications, mostly related to return values