This was broken by 6f7b36d5d0 in February 2013, as join failures are the only situation where a non-trivial numeric is passed through from other code to be sent to a client. Fix it by porting more code from ircd-ratbox 3.1.
6f7b36d5d0