Attempt to further reduce error spam.
Also removed an unnecessary instanceof, because line wrapping is annoying.
Right shift uses floor rounding - remove call to Math