Added error if no factory specified.