fixed int casting to satisfy old python needs