fix ArithmeticException in Adapters