Fixed bug in custom.py.