Reimplemented function to account for odd Ruby optional arguments.