code fixes for bugs raised by offshore