Various changes to make compiler happy