more unbelievable minor cleanup
fix integer cast error