Fixed various warnings about return values.