Fixing the bugs.
Locations can now be passed too.