Bugfix - allow object to be passed as well as string