Fixed bug found by Ehsan Naeini
Fixed bug found by Ehsan Naeini

askogvold/jtk,MinesJTK/jtk,dhale/jtk,dhale/jtk,chrisengelsma/jtk,chrisengelsma/jtk,ctrueden/jtk,voltnor/jtk,ctrueden/jtk,askogvold/jtk,askogvold/jtk,MinesJTK/jtk,MinesJTK/jtk,voltnor/jtk,ctrueden/jtk,chrisengelsma/jtk,voltnor/jtk,dhale/jtk,voltnor/jtk,ctrueden/jtk,askogvold/jtk