Corrected database tasks when custom ports are defined