Fix for Issue #198

Added simple type validation for the for the input of the
setmaxListeners calls.