Replace hardcoded store ID = 1 with either input argument or detected default store ID.

@tim-bezhashvyly nevermind - read through the code a little more carefully and makes sense now :)