take default values into account

fixes hadley/memoise#1