array boundary fix
small fixes