Fixed shared instance error for unit testing