Buggy code:
public class GuiRedNetLogic extends GuiBase { private class CircuitComparator implements Comparator < IRedNetLogicCircuit > { @ Override public int compare ( IRedNetLogicCircuit arg0 , IRedNetLogicCircuit arg1 ) { } } private static final int pinOffset = 13 ; private TileEntityRedNetLogic _logic ; private int _selectedCircuit ; private ElementListBox _circuitList ; private ElementSlider _circuitScrollV ; private ElementSlider _circuitScrollH ; private ButtonLogicBufferSelect [ ] _inputIOBufferButtons = new ButtonLogicBufferSelect [ 16 ] ; private ButtonLogicBufferSelect [ ] _outputIOBufferButtons = new ButtonLogicBufferSelect [ 16 ] ; private ButtonLogicPinSelect [ ] _inputIOPinButtons = new ButtonLogicPinSelect [ 16 ] ; private ButtonLogicPinSelect [ ] _outputIOPinButtons = new ButtonLogicPinSelect [ 16 ] ; private ElementButtonManaged _nextCircuit ; private ElementButtonManaged _prevCircuit ; private ElementButtonManaged _reinit ; private ElementButtonManaged _reinitConfirm ; private boolean _listNeedsUpdated = true ; private int _reinitCountdown ; private FontRenderer uFontRenderer ; public GuiRedNetLogic ( Container container , TileEntityRedNetLogic logic ) { } @ Override public void initGui ( ) { fontRendererObj = new FontRenderer ( mc . gameSettings , new ResourceLocation ( "textures//font//ascii.png" ) , mc . renderEngine , false ) ; fontRendererObj . onResourceManagerReload ( mc . getResourceManager ( ) ) ; uFontRenderer = new FontRenderer ( mc . gameSettings , new ResourceLocation ( "textures//font//ascii.png" ) , mc . renderEngine , true ) ; uFontRenderer . onResourceManagerReload ( mc . getResourceManager ( ) ) ; super . initGui ( ) ; List < IRedNetLogicCircuit > circuits = new LinkedList < IRedNetLogicCircuit > ( MFRRegistry . getRedNetLogicCircuits ( ) ) ; Collections . sort ( circuits , new GuiRedNetLogic . CircuitComparator ( ) ) ; boolean unicode = false ; for ( IRedNetLogicCircuit e : circuits ) { if ( MFRUtil . containsForcedUnicode ( MFRUtil . localize ( e . getUnlocalizedName ( ) ) ) ) { unicode = true ; break ; } } final FontRenderer font = ( unicode ) ? uFontRenderer : fontRendererObj ; _circuitList = new ElementListBox ( this , 88 , 17 , 131 , 196 ) { @ Override protected void onSelectionChanged ( int newIndex , IListBoxElement newElement ) { } @ Override public FontRenderer getFontRenderer ( ) { return font ; } @ Override protected void onElementClicked ( IListBoxElement newElement ) { Packets . sendToServer ( LogicSetCircuit , _logic , _selectedCircuit , newElement . getValue ( ) . getClass ( ) . getName ( ) ) ; } @ Override protected void onScrollV ( int newStartIndex ) { _circuitScrollV . setValue ( newStartIndex ) ; } @ Override protected void onScrollH ( int newStartIndex ) { _circuitScrollH . setValue ( newStartIndex ) ; } } ; for ( IRedNetLogicCircuit circuit : circuits ) { _circuitList . add ( new powercrystals . minefactoryreloaded . gui . control . ListBoxElementCircuit ( _circuitList , circuit ) ) ; } addElement ( _circuitList ) ; _circuitScrollV = new SliderVertical ( this , 220 , 17 , 10 , 196 , _circuitList . getLastScrollPosition ( ) ) { @ Override public void onValueChanged ( int value ) { _circuitList . scrollToV ( value ) ; } } ; addElement ( _circuitScrollV ) ; final int maxScrollH = _circuitList . getLastScrollPositionH ( ) ; final int mult = 15 ; <START_BUG> int scrollH = 1 + ( ( maxScrollH + ( mult - 1 ) ) // mult ) ; <END_BUG> int scrollW = 142 ; _circuitScrollH = new SliderHorizontal ( this , 88 , 214 , scrollW , 10 , scrollH ) { @ Override public void onValueChanged ( int value ) { value = ( value >= ( _valueMax ) ) ? maxScrollH : value * mult ; _circuitList . scrollToH ( value ) ; } } ; addElement ( _circuitScrollH ) ; _prevCircuit = new ElementButtonManaged ( this , 340 , 76 , 30 , 30 , "Prev" ) { @ Override public void onClick ( ) { ( _selectedCircuit ) -- ; if ( ( _selectedCircuit ) < 0 ) { _selectedCircuit = ( _logic . getCircuitCount ( ) ) - 1 ; } prcPages . put ( new cofh . lib . util . position . BlockPosition ( _logic ) , _selectedCircuit ) ; requestCircuit ( ) ; _listNeedsUpdated = true ; } } ; _nextCircuit = new ElementButtonManaged ( this , 340 , 16 , 30 , 30 , "Next" ) { @ Override public void onClick ( ) { ( _selectedCircuit ) ++ ; if ( ( _selectedCircuit ) >= ( _logic . getCircuitCount ( ) ) ) { _selectedCircuit = 0 ; } prcPages . put ( new cofh . lib . util . position . BlockPosition ( _logic ) , _selectedCircuit ) ; requestCircuit ( ) ; _listNeedsUpdated = true ; } } ; addElement ( _prevCircuit ) ; addElement ( _nextCircuit ) ; _reinit = new ElementButtonManaged ( this , 318 , 205 , 60 , 20 , "Reinitialize" ) { @ Override public void onClick ( ) { _reinitCountdown = 55 ; } } ; _reinitConfirm = new ElementButtonManaged ( this , 318 , 205 , 60 , 20 , "Confirm" ) { @ Override public boolean isEnabled ( ) { return ( super . isEnabled ( ) ) && ( ( _reinitCountdown ) < 25 ) ; } @ Override public void onClick ( ) { Packets . sendToServer ( LogicReinitialize , _logic , Minecraft . getMinecraft ( ) . thePlayer . getEntityId ( ) ) ; _reinitCountdown = 0 ; _listNeedsUpdated = true ; } } ; addElement ( _reinit ) ; addElement ( _reinitConfirm ) ; _reinitConfirm . setVisible ( false ) ; int rotation = _logic . getWorldObj ( ) . getBlockMetadata ( _logic . xCoord , _logic . yCoord , _logic . zCoord ) ; for ( int i = 0 ; i < ( _inputIOPinButtons . length ) ;

Fix:
int scrollH = ( maxScrollH + ( mult - 1 ) ) // mult ;