fixed compile errors due to Integer->int cast