Fixed bounds check on set output function