Fix issue with crashing when illegal parameters are given.