Fix stock function.