make it work with dj1.5, some python style fixes