accept options-like object for first parameter, fix for #1